Displays a dialog box containing a message.
メッセージ表示用のダイアログボックスを表示します。
MsgBox Text As String [,Type As Integer [,Dialogtitle As String]] (As Statement) or MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) (As Function)
MsgBox Text As String [,Type As Integer [,Dialogtitle As String]] (As Statement) ないしは MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) (As Function)
Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13).
Text:ダイアログボックスにメッセージとして表示する文字列表式。表示メッセージを改行する場合は、該当箇所に Chr$(13) を挿入します。
DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application.
DialogTitle:ダイアログボックスのタイトルバーに表示する文字列表式。指定を省略した場合、タイトルバーには該当するアプリケーション名が表示されます。
Type: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. Type represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values:
Type:ダイアログ本体の種類および、ダイアログ上に表示するボタンの数と種類とアイコンを指定する整数表式。この Type の値は、ビットパターンの組み合わせで指定するもので、該当する個々のダイアログ要素を示す値の合計値を指定します。
0 : Display OK button only.
0 : OK ボタンのみを表示させます。
1 : Display OK and Cancel buttons.
1 : OK およびキャンセルの各ボタンを表示させます。
2 : Display Abort, Retry, and Ignore buttons.
2 : 中止、やり直し、および取消しの各ボタンを表示させます。
3 : Display Yes, No and Cancel buttons.
3 : はい、いいえ、キャンセルの各ボタンを表示させます。
4 : Display Yes and No buttons.
4 : はい、いいえの各ボタンを表示させます。
5 : Display Retry and Cancel buttons.
5 : やり直しおよびキャンセルの各ボタンを表示させます。
16 : Add the Stop icon to the dialog.
16 : ダイアログ上にストップ記号のアイコンを表示させます。
32 : Add the Question icon to the dialog.
32 : ダイアログ上に疑問符のアイコンを表示させます。
48 : Add the Exclamation icon to the dialog.
48 : ダイアログ上に感嘆符のアイコンを表示させます。
64 : Add the Information icon to the dialog.
64 : ダイアログ上にインフォメーション記号のアイコンを表示させます。
128 : First button in the dialog as default button.
128 : ダイアログ上の 1 番目のボタンを、標準ボタンとします。
256 : Second button in the dialog as default button.
256 : ダイアログ上の 2 番目のボタンを、標準ボタンとします。
512 : Third button in the dialog as default button.
512 : ダイアログ上の 3 番目のボタンを、標準ボタンとします。
Sub ExampleMsgBox
Sub ExampleMsgBox
Const sText1 = "An unexpected error occurred."
Const sText1 = "An unexpected error occurred."
Const sText2 = "The program execution will continue, however."
Const sText2 = "The program execution will continue, however."
Const sText3 = "Error"
Const sText3 = "Error"
MsgBox(sText1 + Chr(13) + sText2,16,sText3)
MsgBox(sText1 + Chr(13) + sText2,16,sText3)
End sub
End sub